Refactor/jira kan 67 지갑 거래내역 관리 new#79
Merged
Conversation
CryingPerson
reviewed
Apr 1, 2025
Collaborator
CryingPerson
left a comment
There was a problem hiding this comment.
전체적으로 설명이 좀 필요할거 같습니다
src/main/java/bumblebee/xchangepass/domain/wallet/transaction/consumer/DeadLetterConsumer.java
Show resolved
Hide resolved
| public static WalletTransactionListResponse fromEntity(WalletTransaction transaction) { | ||
| Wallet counterWallet = transaction.getCounterWallet(); | ||
|
|
||
| return new WalletTransactionListResponse( |
Collaborator
There was a problem hiding this comment.
Builder 패턴 대신 new 로 쓰신 이유가 있으신가여???
Collaborator
Author
There was a problem hiding this comment.
굳이 builder패턴을 사용하지 않아도 된다고 판단했습니다
# Conflicts: # src/test/java/bumblebee/xchangepass/domain/exchangeTransaction/service/ExchangeTransactionServiceTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠️ 과제 요약
📝 요구 사항과 구현 내용
✅ 피드백 반영사항
거래내역 비동기 처리 설명
https://www.notion.so/1bd5e1ebf98580e28293c1608beecaf7?pvs=4
querydsl 동적페이징
https://www.notion.so/queryDSL-1c75e1ebf98580e891eff5f34dc96d51?pvs=4
💬 PR 포인트 & 궁금한 점
송금 시 상대방의 이름과 전화번호로 전송하는 방식으로 변경
Test환경 Docker로 변경
`@Container
static PostgreSQLContainer<?> postgresContainer = new PostgreSQLContainer<>("postgres:16")
.withDatabaseName("xcp_test")
.withUsername("testuser")
.withPassword("testpass");
@container
static GenericContainer<?> rabbitMqContainer = new GenericContainer<>("rabbitmq:3-management")
.withExposedPorts(5672, 15672)
.withEnv("RABBITMQ_DEFAULT_USER", "guest")
.withEnv("RABBITMQ_DEFAULT_PASS", "guest");
@DynamicPropertySource
static void overrideDataSourceProperties(DynamicPropertyRegistry registry) {
registry.add("spring.datasource.url", postgresContainer::getJdbcUrl);
registry.add("spring.datasource.username", postgresContainer::getUsername);
registry.add("spring.datasource.password", postgresContainer::getPassword);
}
@DynamicPropertySource
static void overrideProperties(DynamicPropertyRegistry registry) {
registry.add("spring.rabbitmq.host", rabbitMqContainer::getHost);
registry.add("spring.rabbitmq.port", () -> rabbitMqContainer.getMappedPort(5672));
}`
재시도 3회 이상 시 slack알람 발송
`
@RabbitListener(queues = "wallet-transaction-dlx-queue")
public void handleDeadLetter(WalletTransactionMessage message,
@Header(AmqpHeaders.DELIVERY_TAG) long tag,
@Header("x-death") List<Map<String, Object>> xDeathHeader,
Channel channel) throws IOException {
}
`
MockBean 해결하려고 했으나 실패
https://silky-toothbrush-191.notion.site/MockBean-Deprecated-1c55e1ebf98580d6b078cf4e846dbf3f?pvs=4
@CryingPerson
이거 확인해줘
WalletInOutRequest @builder로 설정했는데 userId는 안받아서
public class ExchangeTransactionService {
if (fromBalance.getBalance().compareTo(amount) < 0) {
WalletInOutRequest chargeRequest = WalletInOutRequest.builder()
// .userId(userId)
.fromCurrency(Currency.getInstance(fromCurrency))
.toCurrency(Currency.getInstance(fromCurrency))
.amount(amount)
.chargeDatetime(LocalDateTime.now())
.build();
// walletService.charge(chargeRequest);
}
+++++
@Validation 관련 어노테이션
@target({FIELD}) | 필드에만 적용 가능 (예: DTO의 필드에 붙여서 사용)
@retention(RUNTIME) | 런타임 시에도 어노테이션 정보 유지
@constraint(validatedBy = CurrencyValidator.class) | 어떤 클래스에서 검증할 것인지 지정
CustomUserDetails 받는 방식으로 변경
public ResponseEntity<?> me(@AuthenticationPrincipal CustomUserDetails user) {
return ResponseEntity.ok("userId = " + user.getUserId());
}
🔗 연관된 이슈